import request from '@/utils/request'

/**
 * 艺术家列表
 * @param {*} params 
 * @returns 
 */
export const getArtistList = (params)=>{
    return new Promise(async (resolve,reject) =>{
      request.post('/boss/artist/list',params).then(res=>{
        resolve(res)
      }).catch(err=>{
        resolve(err)
      })
    })
}

export const edit_artist_data = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/artist/update',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const del_artist = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/artist/delete',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const change_register_user = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/artist/transformArtist',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_artist_detail = (artistId)=>{
  return new Promise(async (resolve,reject) =>{
    request.get(`/boss/artist/detail/${artistId}`).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_goods_detail = (goodsId)=>{
  return new Promise(async (resolve,reject) =>{
    request.get(`/boss/goods/detail/${goodsId}`).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const edit_goods = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post(`/boss/goods/update`,params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}
export const del_goods = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post(`/boss/goods/delete`,params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

/**
 * 新增艺术家
 * @param {*} params 
 * @returns 
 */
export const addArtist = (params)=>{
    return new Promise(async (resolve,reject) =>{
      request.post('/boss/artist/add',params).then(res=>{
        resolve(res)
      }).catch(err=>{
        resolve(err)
      })
    })
}

/**
 * 新增ar地标
 * @param {*} params 
 * @returns 
 */
export const addArLandmark = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arLandmark/add',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

/**
 * AR地标分页接口
 * @param {*} params 
 * @returns 
 */
export const getLandmarkList = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arLandmark/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}
export const del_Landmark_data = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arLandmark/delete',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}
export const edit_Landmark_data = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arLandmark/update',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_Landmark_details = (arLandmarkId)=>{  
  return new Promise(async (resolve,reject) =>{
    request.get(`/boss/arLandmark/detail/${arLandmarkId}`).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

/**
 * AR物体列表
 * @param {*} params 
 * @returns 
 */
export const getArobjectList = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arobject/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

/**
 * U3D场景列表
 * @param {*} params 
 * @returns 
 */
export const getArSceneList = (params)=>{
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arscene/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const getGoodsList = (params)=>{  // 商品列表
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const goodsUp = (params)=>{  // 商品上架
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/up',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const goodsDown = (params)=>{  // 商品下架
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/down',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_meetar_list = (params)=>{  // 遇见艺术AR列表
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arArtist/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const add_meetar_data = (params)=>{  // 添加遇见艺术AR
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arArtist/add',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const del_meetar_data = (params)=>{  // 删除遇见艺术AR
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arArtist/delete',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_meetar_details = (arArtistId)=>{  
  return new Promise(async (resolve,reject) =>{
    request.get(`/boss/arArtist/detail/${arArtistId}`).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const edit_meetar_data = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/arArtist/update',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_cateory_list = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/category/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const add_cateory = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/category/add',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const del_cateory = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/category/delete',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const edit_cateory = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/goods/category/edit',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_order_list = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/order/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_order_detail = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/order/detail',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_user_list = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/user/list',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const get_user_detail = (userId)=>{  
  return new Promise(async (resolve,reject) =>{
    request.get(`/boss/user/detail/${userId}`).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const coupon_send = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/cash/coupon/send',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const settle_list = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/income/queryList',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}
export const settle_detail_list = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/income/queryDetailList',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const sync_u3d_data = ()=>{  
  return new Promise(async (resolve,reject) =>{
    request.get('/mobile/sync/all').then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const uploadFileToserver = (params,flag)=>{ 
  return new Promise(async (resolve,reject) =>{
    request.post('/resource/fileupload/upload',params,{upoadFile:process.env.NODE_ENV=='development'?'/fileApi':''}).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const refund_apply = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/order/refundApply',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}
export const confirm_receiving = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/order/confirmReceiving',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}

export const send_goods = (params)=>{  
  return new Promise(async (resolve,reject) =>{
    request.post('/boss/mall/order/shippingGoods',params).then(res=>{
      resolve(res)
    }).catch(err=>{
      resolve(err)
    })
  })
}